The invention relates to the communication between component objects and host applications, and particularly to a shared component object determining the language of a user interface message by interacting with the host application.
Software vendors are increasingly trying to market their products overseas to take advantage of foreign markets. As expected, foreign markets require that the user interface be presented using local information, specifically a local language, designed for the particular foreign market. For example, users in Japan desire to see user interfaces incorporating the Japanese languages. For some applications, it is possible to install one language set and have the application use this language set for all users that access the application. However some applications are more complex and involve many users and possibly requiring different language interfaces.
Applications that service one or more users may take advantage of shared software components to perform tasks. For example, an application program may service only a single user, but include a shared software component used by multiple applications in different languages. A shared software component is a module that performs a specific task, and can be invoked in response to a request from a user using the same or different applications. When an application services several users and uses a shared software component, the shared software component may be required to generate user interface messages, i.e., information to be sent to the user, in different languages depending on the language of the user making the request. This creates a need for the shared software component to determine the language of a particular user that generates a request invoking the shared software component.
The solution to the above need is not trivial. When the shared software component is created indirectly from a function called by the host application, there is no opportunity to exchange user interface language information with the host application. The software component must first obtain the user interface language requirements, however, prior to responding to the user request.
There have been attempts to address the need for a shared software component to determine the language of a user interface message based on a user request. Previously, applications have addressed this need by making assumptions about the user interface language. These assumptions include selecting the user interface language of the operating system or of the installed application as the language of the user interface message. However, in a shared environment, these assumptions may be incorrect because several users using the shared software component may require the user interface messages in different languages. For example, if the operating system installs one language and the application installs another language, then one will present a user interface message in the wrong language.
Another prior solution is adding a parameter to all interfaces that comprise the user interface language. While this works well with the applications and shared software components that are designed to use this additional parameter, previously developed software components that do not use this additional parameter cannot take advantage of this solution. Furthermore, many prior shared software components are immutable and used in hundreds of existing applications. Consequently, there is a vast array of existing software components for which this solution does not apply.
Therefore, there exists a need to provide a method for communicating between a host application and a shared software component, wherein new and existing shared software components can determine the language of a user interface message without modification to incorporate another parameter.
The present invention meets the needs described above by providing a method for communicating between a host program and a shared software component that allows both new and existing shared software components to determine the language of a user interface message. While the present invention supports requests received from several applications, for simplicity, it will be described in terms of requests from multiple users using one application. In addition, the host program may include those programs such as a host application that runs under an operating system, the operating system itself or any other type of program module that can be executed on a computer system. Again, for simplicity, the present invention will be described in terms of a host application. Generally described, the present invention provides a method wherein a function call that is accessible to the host application and the shared software component is utilized to pass the language information stored at the host application to the software component. In the event that the shared software component, or the host application, cannot determine the language of the user, the shared software component follows a priority system to determine the language of the user interface message.
The advantage of using a function call accessible to the host application and the shared software component is that no modification to the existing host application or shared software component to support a new function is required. This is particularly advantageous when dealing with existing shared software components. In addition, using a priority system for the shared software component to follow, in the event the language of the user interface message cannot be determined from the host application, provides for a well-defined and predictable determination of the language of the user interface message.
The present invention incorporates a host application, users and a shared software component. The shared software component is invoked by the host application to perform a specific task for the user. Multiple users may desire the specific task performed by the shared software component. When multiple users request this specific task from the host application, the shared software component can be used to perform this specific task for the multiple users, thereby being shared among them. When multiple users require this specific task, but have different user interface languages in which to receive information generated by the shared software component, the present invention provides a method for the shared software component to determine the language of a specific user and to generate a user interface message in the language desired by that user.
The host application receives a request from a user. In response to the user""s request, a host application invokes a shared software component to perform a task addressing the user""s request. This task typically includes generating a user interface message. To determine the appropriate language for the user interface message, the shared software component queries the host application to identify the user and to return the user interface language requirements for the user. In the case where the host application is an end-user application, the host returns the current user interface language as the user interface language requirement. If the host application is a server application using a multi-threaded environment, the host application returns the user interface language of the currently running thread at the time of the query. If the host application is not an end-user application or does not use a multi-threaded architecture, the software component provides contextual information in a parameter of the query to aid the host application in determining the user interface language requirements.
In the event that the host application does not support the query function from the shared software component, or the shared software component cannot determine the user interface language from the information provided by the host application, the software component follows a priority system to determine the user interface language. The shared software component first locates the host application""s executable file to access the local information stored in that executable file. If the software component cannot determine the user interface language from the local information, the software component then looks to the user interface language currently selected for the operating system. This will be checked when the operating system supports a user input language definition that is separate from the user interface language definition for the operating system. If the software component cannot determine the user interface requirements from the user interface language currently selected for the operating system or separate language definitions are not supported, the software component will use the currently installed language for the operating system.
After receiving the user interface language requirements from the host application or from the priority system, the shared software component generates the user interface message based on the language defined in the user interface language requirements.